|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectmisc.Serializer<A>
A - class of the object which is serialized.public class Serializer<A>
Series of methods to (un)serialize an object to a string to store it as a file.
| Constructor Summary | |
|---|---|
Serializer(java.lang.String fileName)
Create an object to serialize a class. |
|
Serializer(java.lang.String fileName,
boolean log)
Create an object to serialize a class. |
|
| Method Summary | |
|---|---|
java.lang.String |
getFileName()
|
A |
readFromDisk()
Read a serialized object from a file and restore it. |
A |
readStringToObject(java.lang.String str)
Converts a string back to an object. |
void |
writeToDisk(A a)
Serializes an object to the specified file. |
java.lang.String |
writeToString(A a)
Serializes an object to a string encoded by using Base64 to avoid characterset problems. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Serializer(java.lang.String fileName)
fileName - path to file in which the serialized class is stored.
public Serializer(java.lang.String fileName,
boolean log)
fileName - path to file in which the serialized class is stored.log - specifies if file not found exceptions should be reported.| Method Detail |
|---|
public A readFromDisk()
public void writeToDisk(A a)
a - object to be serialized.public java.lang.String writeToString(A a)
a - object to serialize.
public A readStringToObject(java.lang.String str)
str - serialized object.
public java.lang.String getFileName()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||